Ok to edit task's xml file in c:\windows\system32\Tasks?
I wrote a PowerShell script that check the executable in the < action > tag for each task in the Task directory and mark the < enabled >TRUEorFALSE< / enabled > tag as false/true depending on the validity of the digital signature of the executable. After reading each task, the script re-saves the task file with the same name, type and location. Now my issue is that I get this message when I lunch task scheduler: Task XYZ: The task image is corrupt or has been tampered with. This message appears for all the tasks that were scanned and saved. Does editing tasks xml file directly corrupt the task? Is there any task decency that may cause this error(ex: registry value)?
October 20th, 2012 9:13am

When reading the contents of this .XML file, why would you want to re-save it? Just closing it would suffice and would avoid the problem! Since scheduled tasks can easily be used/abused by hackers, it is possible that Windows uses extra security features to prevent tampering of any kind. You could find out like so: Get your script to save the file under a different name.Use fc.exe /b to compare the two files with each other.
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2012 9:45am

well, I re-save the file because I want the true/false values of the <enabled> tag to be saved. My script have to disable all tasks with non-valid digital signature.
October 20th, 2012 12:22pm

The proper way to disable an existing task is either with schtasks.exe or the equivalent PS method, e.g. like so: schtasks /change /tn Reminder /disable Hacking the XML file is not recommended unless you know its structure in detail.
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2012 1:41pm

The proper way to disable an existing task is either with schtasks.exe or the equivalent PS method, e.g. like so: schtasks /change /tn Reminder /disable Hacking the XML file is not recommended unless you know its structure in detail.
October 20th, 2012 1:52pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics